package com.czy.form.model;

import com.fasterxml.jackson.annotation.JsonView;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

/***
 * @ ClassName: FormMeta
 * @ Description: 元数据
 * @ author：libi
 * @ date： 2020/2/1 13:06
 * @ version： V1.0.0
 * @ CopyRight：czy
 */

@MappedSuperclass
@Data
public abstract class FormMeta implements Serializable {

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid2")
    @Column(name = "id", unique = true, length = 36, columnDefinition = "varchar(36) comment '唯一主键'")
    @JsonView(SimpleView.class)
    String id;

    @Column(name = "name")
    @JsonView(SimpleView.class)
    String name;

    public interface SimpleView{}
}
